DataGrid - AI Assistant: Support Store Push API#33584
Merged
Alyar666 merged 2 commits intoMay 14, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the DataGrid AI Assistant integration to better support the Store Push API by reacting to message store push events and routing user-inserted messages into the AI request pipeline.
Changes:
- Added
AIChat.getUserId()so the assistant can detect which pushed messages belong to the current user. - Switched the assistant view to bind dxChat to an
ArrayStoreand subscribe to storepushevents to trigger requests for inserted user messages. - Refactored the controller API from “get message dataSource” to “get message store”, and updated unit tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts | Exposes chat user id via a new getUserId() helper. |
| packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.test.ts | Adds coverage for getUserId() behavior (initialized/uninitialized cases). |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/utils.ts | Adds isUserMessage helper for author-id matching. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts | Subscribes to store push events and triggers AI requests on inserted user messages; binds chat dataSource to the store. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_controller.ts | Replaces getMessageDataSource() with getMessageStore(). |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/utils.test.ts | Adds unit tests for isUserMessage. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_view.test.ts | Updates view tests for store-based dataSource and adds push-handler tests. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_controller.test.ts | Updates controller tests to validate getMessageStore(). |
Comments suppressed due to low confidence (1)
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts:119
subscribeMessageStorePushattaches a long-livedstore.on('push', ...)listener but there is no corresponding unsubscription on view disposal. This can keep the view instance reachable and/or invokehandleMessageStorePushafter the view is disposed. Add adispose()(or equivalent lifecycle hook) to callmessageStore.off('push', this.handleMessageStorePushContext).
private subscribeMessageStorePush(messageStore: ArrayStore<Message, string>): void {
messageStore.off('push', this.handleMessageStorePushContext);
messageStore.on('push', this.handleMessageStorePushContext);
}
Raushen
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.